package com.bwie.utils;

import io.jsonwebtoken.Jwts;

/**
 * @description :
 * @Author QiHainan
 * @Create 2025/6/20 10:58
 * @Version 1.0
 */
public class TokenUtils {
    public static Integer getUserId(String token){
        Integer userId = Jwts.parser().setSigningKey("123456").parseClaimsJws(token).getBody().get("userId", Integer.class);
        return userId;
    }

    public static String getUserName(String token){
        String userName = Jwts.parser().setSigningKey("123456").parseClaimsJws(token).getBody().get("userName", String.class);
        return userName;
    }
}
